/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86136
 * Date: 2025-04-07
 * Time: 15:05
 */
public class Demo17 {
    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(() -> {
           while(true) {
               System.out.println("hello thread");
               try {
                   Thread.sleep(1000);
               } catch (InterruptedException e) {
                   e.printStackTrace();
               }
           }
        });
        t.start();
        t.join(6000*1000);
    }
}
